<?php
//通过接口实现多态
//接口只是定义规范,但是不实现任何的功能
interface employee{
    public function working();
}

class teacher implements employee{
    public function working(){
        echo '教书';
    }
}

class coder implements employee{
    public function working()
    {
        echo '码代码';
    }
}

function doprint(employee $i){
   $i = $i->working();
}

$a = new teacher();
$b = new coder();
doprint($a);
echo "\r\n";
doprint($b);